<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Controller extends CI_Controller {

	function __construct()
    {
        parent::__construct();
		
		//load helpers, libraries
		$this->load->library('session');
		$this->load->helper('url');
		
		//check if logged
		if (!$this->session->userdata('logged_in') && (current_url() != base_url().'index.php/login')){   
			redirect('login');
        }
    }

}